<?php
$path=dirname(dirname(__FILE__))."/lib/";

function scan($base,$path){
    $list=scandir($base.$path);
    $result=array();
    foreach($list as $item){
        if($item=="." || $item==".."){
            continue;
        }
        if(is_file($base.$path.$item)){
            $pi=pathinfo($base.$path.$item);
            if(strtolower($pi["extension"])!="php") continue;
            $key=basename($item,".php");
            $result[$key]=$path.$item;
        }
        else{
            $result=array_merge($result,scan($base,$path.$item."/"));
        }
    }
    return $result;
}

$clsMap=scan($path,"");
foreach($clsMap as $cls=>$fn){
    echo "\"{$cls}\"=>\"{$fn}\",<br/>";
}